<template>
  <el-menu :collapse="isCollapse" collapse-transition  class="el-menu-vertical-demo" style="width: 100%;" text-color="#000" router unique-opened>
    <el-submenu :index="item.path" v-for="item in menu" :key="item.id" >
      <template slot="title">
        <i :class="item.icon"></i>
        <span>{{ item.title }}</span>
      </template>
      <el-menu-item v-for="sub in item.children" :index="sub.path" :key="sub.path">
        <template slot="title">
          <i :class="sub.icon"></i>
          <span> {{ sub.title }}</span>
        </template>
      </el-menu-item>
    </el-submenu>
  </el-menu>
</template>   

<script>
import { nanoid } from 'nanoid'

export default {
  props:['isCollapse'],
  data() {
    return {
      menu: [
        {
          id: nanoid(),
          title: '用户管理',
          icon: 'el-icon-user-solid',
          path: '/user',
          children: [
            {
              id: nanoid(),
              title: '用户列表',
              icon: 'el-icon-user',
              path: '/AllUser',
            },
            // {
            //   id: nanoid(),
            //   title: '个人中心',
            //   icon: 'el-icon-user',
            //   path: '/Personal',
            // },
            {
              id: nanoid(),
              title: '修改密码',
              icon: 'el-icon-user',
              path: '/ChangePassword',
            }
          ]
        },
        {
          id: nanoid(),
          title: '订单管理',
          path: '/order',
          icon: 'el-icon-s-cooperation',
          children: [
            {
              id: nanoid(),
              title: '订单列表',
              icon: 'el-icon-user',
              path: '/Indent',
            }
          ]
        },
        {
          id: nanoid(),
          title: '医院管理',
          path: '',
          icon: 'el-icon-office-building',
          children: [
            {
              id: nanoid(),
              title: '医院管理',
              path: '/Hospital',
              icon: 'el-icon-school',
            },
            {
              id: nanoid(),
              title: '科室管理',
              path: '/Dept',
              icon: 'el-icon-s-order',
            },
            {
              id: nanoid(),
              title: '病房管理',
              path: '/Sickroom',
              icon: 'el-icon-wallet',
            }
          ]
        },// end
        {
          id: nanoid(),
          title: '床位管理',
          path: '/bed',
          icon: 'el-icon-postcard',
          children: [
            {
              id: nanoid(),
              title: '床位列表',
              path: '/Bed',
              icon: 'el-icon-school',
            }
          ]
        },
        {
          id: nanoid(),
          title: '报表中心',
          path: '/repo',
          icon: 'el-icon-moon-night',
          children: [
            {
              id: nanoid(),
              title: '报表概况',
              path: '/AllStatement',
              icon: 'el-icon-connection',
            },
            {
              id: nanoid(),
              title: '销售报表',
              path: '/SaleStatement',
              icon: 'el-icon-s-cooperation',
            }
          ]
        }, //end
        {
          id: nanoid(),
          title: '维修售后',
          path: '/repair',
          icon: 'el-icon-unlock',
          children: [
            {
              id: nanoid(),
              title: '故障列表',
              path: '/Fault',
              icon: 'el-icon-lightning',
            },
            {
              id: nanoid(),
              title: '维修记录',
              path: '/Fix',
              icon: 'el-icon-cloudy',
            }
          ]
        },//end

        // {
        //   id: nanoid(),
        //   title: '人员管理',
        //   path: '/suser',
        //   icon: 'el-icon-refrigerator',
        //   children: [
        //     {
        //       id: nanoid(),
        //       title: '股东/分销商',
        //       path: '/Shareholder',
        //       icon: 'el-icon-coffee',
        //     },
        //     {
        //       id: nanoid(),
        //       title: '医院管理员',
        //       path: '/HospitalAdmin',
        //       icon: 'el-icon-s-cooperation',
        //     },
        //     {
        //       id: nanoid(),
        //       title: '维修人员',
        //       path: '/Repairman',
        //       icon: 'el-icon-s-cooperation',
        //     },
        //     {
        //       id: nanoid(),
        //       title: '公司管理员',
        //       path: '/Admin',
        //       icon: 'el-icon-s-cooperation',
        //     }
        //   ]
        // },//end

        {
          id: nanoid(),
          title: '系统模块',
          path: '/system',
          icon: 'el-icon-s-tools',
          children: [
            {
              id: nanoid(),
              title: '后台用户管理',
              path: '/Emp',
              icon: 'el-icon-user',
            },
            {
              id: nanoid(),
              title: '角色管理',
              path: '/Role',
              icon: 'el-icon-s-operation',
            },
            {
              id: nanoid(),
              title: '权限管理',
              path: '/Permission',
              icon: 'el-icon-s-check',
            },
            {
              id: nanoid(),
              title: '操作日志',
              path: '/Log',
              icon: 'el-icon-view',
            }
          ]
        },//end
      ]
    }
  },
  components: {},
  methods: {

  },
}
</script>

<style lang="less" scoped>
.el-submenu .el-menu-item {
  padding: 0;
}
.el-menu{
  border: none;
}
</style> 

